<template>
  <div class="desc-pic">
    <div class="pic_img  clearfix">
      <div v-for="(item,index) in list.img" :key="index" class="img_li" v-show="list.img">
        <div class="img" v-lazy:background-image="item" @click="preview(index)"></div>
      </div>
      <div class="img_li" v-show="!list.img">
        <div class="no_img"></div>
      </div>
    </div>
  </div>
</template>

<script>
  import wx from 'weixin-js-sdk'

  export default {
    data () {
      return {
        ready: false
      }
    },
    props: ['list'],
    created () {
    },
    methods: {
      preview (index) {
        // if (this.ready) {
        wx.previewImage({
          current: this.list.img[index], // 当前显示图片的http链接
          urls: this.list.img // 需要预览的图片http链接列表
        })
        // }
      }
    }
  }
</script>

<style lang="scss">

  .desc-pic {
    /*padding: 10px;*/
    .desc {
      line-height: 16px;
      color: #292929;
      font-size: 13px;
    }
    .pic_img {
      width: 100%;
      margin-top: 7px;
      .img_li {
        width: 24%;
        height: 80px;
        margin-top: 1%;
        float: left;
        margin-left: 1%;
        background: #f2f2f2;
        .img {
          width: 100%;
          height: 100%;
          background-size: cover;
        }
        .no_img {
          width: 100%;
          height: 100%;
          background-size: cover;
          background: url("../../components/content/images/zanwutupian@2x.png");
          background-size: 100% 100%;
        }
      }
    }
  }
</style>
